<template>
  <el-dialog append-to-body :close-on-click-modal="false" :before-close="crud.cancelCU" :visible="crud.status.cu > 0" :title="crud.status.title" width="700px">
    <el-form ref="form" :model="form" :rules="rules" size="small" label-width="120px">
      <el-form-item label="用户ID">
        <el-input v-model="form.userId" />
      </el-form-item>
      <el-form-item label="用户名">
        <el-input v-model="form.userName" />
      </el-form-item>
      <el-form-item label="有效时间">
        <el-row>
          <el-col span="11">
            <el-date-picker v-model="form.timeScopeStart" type="datetime" />
          </el-col>
          <el-col span="2">
            ——
          </el-col>
          <el-col span="11">
            <el-date-picker v-model="form.timeScopeEnd" type="datetime" />
          </el-col>
        </el-row>
      </el-form-item>
      <el-form-item label="添加原因">
        <el-input v-model="form.joinReason" />
      </el-form-item>
      <el-form-item label="状态">
        <el-select v-model="form.optStatus" filterable placeholder="请选择">
          <el-option v-for="item in dict.dict.status_gw_bl" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue" />
        </el-select>
      </el-form-item>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button type="text" @click="crud.cancelCU">取消</el-button>
      <el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
    </div>
  </el-dialog>
</template>

<script>
import { form } from '@crud/crud'

const defaultForm = { id: null, userId: null, userName: null, timeScopeStart: null, timeScopeEnd: null, joinReason: null, optStatus: null }
export default {
  mixins: [form(defaultForm)],
  props: {
    dict: {
      type: Object,
      required: true
    }
  },
  data() {
    return {
      rules: {
      }
    }
  }
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
  /deep/ .el-input-number .el-input__inner {
    text-align: left;
  }
</style>
